package org.example.qqrobot.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.qqrobot.model.dto.ProductQueryDTO;
import org.example.qqrobot.model.pojo.Product;

import java.util.List;

@Mapper
public interface ProductMapper {






    //查询正常的信息
    List<Product> query(ProductQueryDTO productQueryDTO);

    @Select("select *from product where id = #{id}")
    Product findById(Long id);


    void save(Product product);

    @Select("select *from product where writer = #{currentId}")
    List<Product> findByWriterId(Long currentId);

    @Select("select writer from product where id = #{id}")
    Long findWriterById(Long id);


    List<Product> queryByName(String queryName);
}
